package response

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

func Response(c *gin.Context, httpStates int, code int, data gin.H, msg string) {
	c.JSON(httpStates, gin.H{
		"resultCode": code,
		"data":       data,
		"message":    msg,
	})
}

func Success(c *gin.Context, data gin.H, msg string) {
	Response(c, http.StatusOK, 200, data, msg)
}

func Failure(c *gin.Context, data gin.H, msg string) {
	Response(c, http.StatusOK, 500, data, msg)
}
